home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
os2
/
xdsn217.zip
/
DOC
/
isom2.inf
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1996-07-07
|
41KB
|
1,226 lines
ΓòÉΓòÉΓòÉ 1. Disclaimer ΓòÉΓòÉΓòÉ
This on-line document was generated automatically from its printed version
LaTeX source. Some places in the document (especially tables) may look ugly due
to the conversion program limits. These problems are being worked on and are
supposed to be solved in the final release.
ΓòÉΓòÉΓòÉ 2. Title Page ΓòÉΓòÉΓòÉ
xTech Development System
ISO Modula-2 Language Reference
xTech Ltd, 1996
XDS software and documentation copyright (c) 1991-1996 xTech Ltd. (xTech).
Information in this document is subject to change without notice and does not
represent a commitment on the part of xTech.
All rights reserved. You may use the enclosed software on a single computer;
transfer the software from one computer to another, provided that the software
is used on only one computer at a time and that you remove any copies of the
software on the computer from which the copies were made; make copies of the
software for backup purposes only.
XDS software and documentation have been tested and reviewed. Nevertheless,
xTech makes no warranty or representation, either express or implied, with
respect to the software and documentation included with XDS. In no event will
xTech be liable for direct, indirect, special, incidental or consequential
damages resulting from any defect in the software or documentation included
with this product. In particular, xTech shall have no liability for any
programs or data used with this product, including the cost of recovering
programs or data.
XDS is a trademark of xTech Ltd.
All trademarks and copyrights mentioned in this documentation are the property
of their respective holders.
ΓòÉΓòÉΓòÉ 3. Introduction ΓòÉΓòÉΓòÉ
This document contains lexis and syntax definitions only. The full ISO Modula-2
Reference will be provided after we receive a copy of the recently published
ISO Modula-2 Standard.
ΓòÉΓòÉΓòÉ 4. The Lexis ΓòÉΓòÉΓòÉ
The Modula-2 Lexis is the specification of the lexical elements of Modula-2
source code including white space, comments, source code directives, and the
tokens that are used in the concrete syntax. All the symbols and pervasive
identifiers of Modula-2 are defined in this section.
Source Code Structure
Word tokens
Symbols and Operators
Constant Literals
Separators
Letters and National Characters
ΓòÉΓòÉΓòÉ 4.1. Source Code Structure ΓòÉΓòÉΓòÉ
modula2 source code= { delimited token }, { separator } ;
delimited token= { separator }, token ;
token= word token | symbol | constant literal ;
NOTE: A token is the largest sequence of characters that satisfies the
definitions. Consequently, a word token must be separated from a following word
token, numeric literal, string literal or character number literal.
Furthermore, a numeric literal must be separated from a following numeric
literal or character number literal.
ΓòÉΓòÉΓòÉ 4.2. Word tokens ΓòÉΓòÉΓòÉ
word token= identifier | keyword ;
Identifiers
Portable Identifiers
Full Identifiers
Pervasive Identifiers
Keywords
ΓòÉΓòÉΓòÉ 4.2.1. Identifiers ΓòÉΓòÉΓòÉ
identifier= portable identifier | full identifier | pervasive identifier ;
ΓòÉΓòÉΓòÉ 4.2.2. Portable Identifiers ΓòÉΓòÉΓòÉ
portable identifier=
( simple letter | low line ), { simple alphanumeric | low line } ;
low line= "_" ;
ΓòÉΓòÉΓòÉ 4.2.3. Full Identifiers ΓòÉΓòÉΓòÉ
full identifier=
( national letter | low line ), { national alphanumeric | low line } ;
ΓòÉΓòÉΓòÉ 4.2.4. Pervasive Identifiers ΓòÉΓòÉΓòÉ
pervasive identifier=
"ABS" | "BITSET" | "BOOLEAN" | "CARDINAL" |
"CAP" | "CHR" | "CHAR" | "COMPLEX" |
"CMPLX" | "DEC" | "DISPOSE" | "EXCL" |
"FALSE" | "FLOAT" | "HALT" | "HIGH" |
"IM" | "INC" | "INCL" | "INT" |
"INTERRUPTIBLE" | "INTEGER" | "LENGTH" | "LFLOAT" |
"LONGCOMPLEX" | "LONGREAL" | "MAX" | "MIN" |
"NEW" | "NIL" | "ODD" | "ORD" |
"PROC" | "PROTECTION" | "RE" | "REAL" |
"SIZE" | "TRUE" | "TRUNC" | "UNINTERRUPTIBLE" |
"VAL" ;
NOTE: Pervasive identifiers are not reserved words; if redeclared in a program,
they will no longer have their predefined meaning in the scope of the
redeclared identifier.
ΓòÉΓòÉΓòÉ 4.2.5. Keywords ΓòÉΓòÉΓòÉ
keyword=
"AND" | "ARRAY" | "BEGIN" | "BY" |
"CASE" | "CONST" | "DEFINITION" | "DIV" |
"DO" | "ELSE" | "ELSIF" | "END" |
"EXIT" | "EXCEPT" | "EXPORT" | "FINALLY" |
"FOR" | "FORWARD" | "FROM" | "IF" |
"IMPLEMENTATION" | "IMPORT" | "IN" | "LOOP" |
"MOD" | "MODULE" | "NOT" | "OF" |
"OR" | "PACKEDSET" | "POINTER" | "PROCEDURE" |
"QUALIFIED" | "RECORD" | "REM" | "RETRY" |
"REPEAT" | "RETURN" | "SET" | "THEN" |
"TO" | "TYPE" | "UNTIL" | "VAR" |
"WHILE" | "WITH" ;
NOTE: The keywords AND, DIV, IN, MOD, NOT, OR and REM are operator keywords;
the rest are punctuation keywords.
ΓòÉΓòÉΓòÉ 4.3. Symbols and Operators ΓòÉΓòÉΓòÉ
symbol= required symbol | symbol with alternatives | operator ;
Required Symbols
Symbols with alternatives
Operators
ΓòÉΓòÉΓòÉ 4.3.1. Required Symbols ΓòÉΓòÉΓòÉ
required symbol=
colon | comma | ellipsis | equals |
period | semicolon | left parenthesis | right parenthesis ;
colon= ":" ;
comma= "," ;
ellipsis= ".." ;
equals= "=" ;
period= "." ;
semicolon= ";" ;
left parenthesis= "(" ;
right parenthesis= ")" ;
ΓòÉΓòÉΓòÉ 4.3.2. Symbols with alternatives ΓòÉΓòÉΓòÉ
symbol with alternatives=
left bracket | right bracket | left brace | right brace | case separator ;
left bracket= preferred left bracket | required left bracket ;
preferred left bracket= "[" ;
required left bracket= "(!" ;
right bracket= preferred right bracket | required right bracket ;
preferred right bracket= "]" ;
required right bracket= "!)" ;
left brace= preferred left brace | required left brace ;
preferred left brace= "" ;
required left brace= "(:" ;
right brace= preferred right brace | required right brace ;
preferred right brace= "" ;
required right brace= ":)" ;
case separator= preferred case separator | required case separator ;
preferred case separator= "|" ;
required case separator= "!" ;
ΓòÉΓòÉΓòÉ 4.3.3. Operators ΓòÉΓòÉΓòÉ
operator=
assignment operator | plus operator | set union operator |
string catenate symbol | minus operator | set difference operator |
logical disjunction operator | multiplication operator | division operator |
div operator | mod operator | rem operator |
set intersection operator | symmetric set difference operator |
logical conjunction operator | sign | logical negation operator | equals
operator |
inequality operator | less than operator | greater than operator |
less than or equal operator | greater than or equal operator | subset operator
|
superset operator | set membership operator | dereferencing operator ;
assignment operator= ":=" ;
plus operator= "+" ;
set union operator= "+" ;
string catenate symbol= "+" ;
minus operator= "-" ;
set difference operator= "-" ;
logical disjunction operator= "OR" ;
multiplication operator= "*" ;
division operator= "/" ;
div operator= "DIV" ;
mod operator= "MOD" ;
rem operator= "REM" ;
set intersection operator= "*" ;
symmetric set difference operator= "/" ;
logical conjunction operator= and keyword | and synonym ;
and keyword= "AND" ;
and synonym= "&" ;
sign= identity operator | arithmetic negation operator ;
identity operator= "+" ;
arithmetic negation operator= "-" ;
logical negation operator= not keyword | not synonym ;
not keyword= "NOT" ;
not synonym= "" ;
equals operator= "=" ;
inequality operator= not equals operator | not equals synonym ;
not equals operator= "<>" ;
not equals synonym= "#" ;
less than operator= "<" ;
greater than operator= ">" ;
less than or equal operator= "<=" ;
greater than or equal operator= ">=" ;
subset operator= "<=" ;
superset